package jobs;

import controllers.MailSender;
import models.ApplicationUser;
import play.jobs.Job;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: Valentin
 * Date: 4/29/13
 * Time: 10:04 AM
 * To change this template use File | Settings | File Templates.
 */
public class SenderJob extends Job<String> {

    private String authorId;
    private String modifierId;

    public SenderJob(String pageAuthorId, String pageModifierId){
        authorId = pageAuthorId;
        modifierId = pageModifierId;
    }

    @Override
    public void doJob() throws Exception {
        ApplicationUser author = ApplicationUser.findById(Long.parseLong(authorId));
        ApplicationUser user = ApplicationUser.findById(Long.parseLong(modifierId));
        MailSender sender = new MailSender();
        sender.SendMessage(author.email, "Wiki informer", "Your wiki page was chandged by" + user.name,  "");

        //super.doJob();    //To change body of overridden methods use File | Settings | File Templates.
    }
}
